

package com.timber.util;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Date;

/**
 * class to read date with description from DB using SLDataMgr
 */
public class SLDataDate extends SLDataObjectAdaptor {

    Date date;
    String description;

    public boolean load(ResultSet rs) throws SQLException {
        date = new Date(rs.getTimestamp(1).getTime());
        try { description = rs.getString( 2 ); } catch( Exception ex ){}
        return true;
    }

    public Object hashKey() {
        return date;
    }

    public Date getDate() {
        return date;
    }

    public String getDescription() {
        return description;
    }
}
